﻿@using ZoomLa.Common
@{
    int qtype = DataConverter.CLng(Request.QueryString["qtype"],99);
}
@section head{
    <title>试卷题目管理</title>
}
@section content{
    <div class="container-fluid mysite marginbot10" id="BreadDiv">
        <div class="row">
            <ol id="BreadNav" class="breadcrumb navbar-fixed-top">
                <li class="active">
                    <a href="Papers_System_Manage">试卷列表</a>[@ViewBag.ptitle]
                    <a href='javascript:;' onclick='SelQuestion()'>[选择试题]</a>
                </li>
            </ol>
        </div>
    </div>
    <ul class="nav nav-tabs hidden-xs hidden-sm">
        <li id="tab_99"><a href="#tab-1" data-toggle="tab" onclick="ShowTabs(99)">所有内容</a></li>
        <li id="tab_0"><a href="#tab0" data-toggle="tab" onclick="ShowTabs(0)">单选题</a></li>
        <li id="tab_1"><a href="#tab1" data-toggle="tab" onclick="ShowTabs(1)">多选题</a></li>
        <li id="tab_2"><a href="#tab2" data-toggle="tab" onclick="ShowTabs(2)">填空题</a></li>
        <li id="tab_3"><a href="#tab3" data-toggle="tab" onclick="ShowTabs(3)">解析题</a></li>
        <li id="tab_10"><a href="#tab10" data-toggle="tab" onclick="ShowTabs(10)">大题</a></li>
    </ul>
    @Html.Partial("Paper_QuestionManage_List")
    <button id="del_btn" class="btn btn-primary" onclick="mvcpage.bat({ url: 'Question_Del', confirm: '是否删除选中项？' });">批量删除</button>
    <input type="hidden" id="SelIDS_IDS" name="SelIDS_IDS" value="@ViewBag.selids" />
}
@section script{
    <script type="text/javascript" src="/JS/Controls/ZL_Dialog.js"></script>
    <script type="text/javascript">
        $(function () {
            ActiveTab(@qtype);
        })
        var diag = new ZL_Dialog();
        function CheckAll(spanChk)//CheckBox全选
        {
            var oItem = spanChk.children;
            var theBox = (spanChk.type == "checkbox") ? spanChk : spanChk.children.item[0];
            xState = theBox.checked;
            elm = theBox.form.elements;
            for (i = 0; i < elm.length; i++)
                if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
                    if (elm[i].checked != xState)
                        elm[i].click();
                }
        }
        function SelQuestion() {
            diag.title = "选择题目";
            diag.url = "/User/Exam/SelQuestion?pid=@Request.QueryString["pid"]&selids=" + $("#SelIDS_IDS").val();
            diag.maxbtn = false;
            diag.ShowModal();
        }
        function CLoseDIag() {
            diag.CloseModal();
            window.location = location;
        }
        function ActiveTab(id) {
            $("#tab_" + id).addClass("active");
        }
        function ShowTabs(id) {
            location.href = "Paper_QuestionManage?qtype=" + id + "&pid=@Request.QueryString["pid"]";
        }
    </script>
}